-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[llvm] annotate interfaces in llvm/CGData and llvm/CodeGen for DLL export #140823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-llvm-regalloc Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with The following manual adjustments were also applied after running IDS on Linux:
ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Patch is 646.67 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140823.diff 101 Files Affected:
diff --git a/llvm/include/llvm/CGData/CodeGenData.h b/llvm/include/llvm/CGData/CodeGenData.h
index 0e7dd2f5b5c1a..ad7fa579f7508 100644
--- a/llvm/include/llvm/CGData/CodeGenData.h
+++ b/llvm/include/llvm/CGData/CodeGenData.h
@@ -23,6 +23,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Caching.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/Triple.h"
#include <mutex>
@@ -34,9 +35,9 @@ enum CGDataSectKind {
#include "llvm/CGData/CodeGenData.inc"
};
-std::string getCodeGenDataSectionName(CGDataSectKind CGSK,
- Triple::ObjectFormatType OF,
- bool AddSegmentInfo = true);
+LLVM_ABI std::string getCodeGenDataSectionName(CGDataSectKind CGSK,
+ Triple::ObjectFormatType OF,
+ bool AddSegmentInfo = true);
enum class CGDataKind {
Unknown = 0x0,
@@ -47,7 +48,7 @@ enum class CGDataKind {
LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/StableFunctionMergingMap)
};
-const std::error_category &cgdata_category();
+LLVM_ABI const std::error_category &cgdata_category();
enum class cgdata_error {
success = 0,
@@ -63,7 +64,7 @@ inline std::error_code make_error_code(cgdata_error E) {
return std::error_code(static_cast<int>(E), cgdata_category());
}
-class CGDataError : public ErrorInfo<CGDataError> {
+class LLVM_ABI CGDataError : public ErrorInfo<CGDataError> {
public:
CGDataError(cgdata_error Err, const Twine &ErrStr = Twine())
: Err(Err), Msg(ErrStr.str()) {
@@ -130,7 +131,7 @@ class CodeGenData {
public:
~CodeGenData() = default;
- static CodeGenData &getInstance();
+ LLVM_ABI static CodeGenData &getInstance();
/// Returns true if we have a valid outlined hash tree.
bool hasOutlinedHashTree() {
@@ -245,8 +246,8 @@ struct StreamCacheData {
/// \p Task represents the partition number in the parallel code generation
/// process. \p AddStream is the callback used to add the serialized module to
/// the stream.
-void saveModuleForTwoRounds(const Module &TheModule, unsigned Task,
- AddStreamFn AddStream);
+LLVM_ABI void saveModuleForTwoRounds(const Module &TheModule, unsigned Task,
+ AddStreamFn AddStream);
/// Load the optimized bitcode module for the second codegen round.
/// \p OrigModule is the original bitcode module.
@@ -254,18 +255,18 @@ void saveModuleForTwoRounds(const Module &TheModule, unsigned Task,
/// process. \p Context provides the environment settings for module operations.
/// \p IRFiles contains optimized bitcode module files needed for loading.
/// \return A unique_ptr to the loaded Module, or nullptr if loading fails.
-std::unique_ptr<Module> loadModuleForTwoRounds(BitcodeModule &OrigModule,
- unsigned Task,
- LLVMContext &Context,
- ArrayRef<StringRef> IRFiles);
+LLVM_ABI std::unique_ptr<Module>
+loadModuleForTwoRounds(BitcodeModule &OrigModule, unsigned Task,
+ LLVMContext &Context, ArrayRef<StringRef> IRFiles);
/// Merge the codegen data from the scratch objects \p ObjectFiles from the
/// first codegen round.
/// \return the combined hash of the merged codegen data.
-Expected<stable_hash> mergeCodeGenData(ArrayRef<StringRef> ObjectFiles);
+LLVM_ABI Expected<stable_hash>
+mergeCodeGenData(ArrayRef<StringRef> ObjectFiles);
-void warn(Error E, StringRef Whence = "");
-void warn(Twine Message, StringRef Whence = "", StringRef Hint = "");
+LLVM_ABI void warn(Error E, StringRef Whence = "");
+LLVM_ABI void warn(Twine Message, StringRef Whence = "", StringRef Hint = "");
} // end namespace cgdata
@@ -297,7 +298,7 @@ struct Header {
// the new field is read correctly.
// Reads a header struct from the buffer.
- static Expected<Header> readFromBuffer(const unsigned char *Curr);
+ LLVM_ABI static Expected<Header> readFromBuffer(const unsigned char *Curr);
};
} // end namespace IndexedCGData
diff --git a/llvm/include/llvm/CGData/CodeGenDataReader.h b/llvm/include/llvm/CGData/CodeGenDataReader.h
index 085dd6dd747c9..f915ce0afcd7f 100644
--- a/llvm/include/llvm/CGData/CodeGenDataReader.h
+++ b/llvm/include/llvm/CGData/CodeGenDataReader.h
@@ -16,6 +16,7 @@
#include "llvm/CGData/CodeGenData.h"
#include "llvm/CGData/OutlinedHashTreeRecord.h"
#include "llvm/CGData/StableFunctionMapRecord.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/VirtualFileSystem.h"
@@ -49,12 +50,12 @@ class CodeGenDataReader {
/// Factory method to create an appropriately typed reader for the given
/// codegen data file path and file system.
- static Expected<std::unique_ptr<CodeGenDataReader>>
+ LLVM_ABI static Expected<std::unique_ptr<CodeGenDataReader>>
create(const Twine &Path, vfs::FileSystem &FS);
/// Factory method to create an appropriately typed reader for the given
/// memory buffer.
- static Expected<std::unique_ptr<CodeGenDataReader>>
+ LLVM_ABI static Expected<std::unique_ptr<CodeGenDataReader>>
create(std::unique_ptr<MemoryBuffer> Buffer);
/// Extract the cgdata embedded in sections from the given object file and
@@ -62,7 +63,7 @@ class CodeGenDataReader {
/// is used by `llvm-cgdata --merge` or ThinLTO's two-codegen rounds.
/// Optionally, \p CombinedHash can be used to compuate the combined hash of
/// the merged data.
- static Error
+ LLVM_ABI static Error
mergeFromObjectFile(const object::ObjectFile *Obj,
OutlinedHashTreeRecord &GlobalOutlineRecord,
StableFunctionMapRecord &GlobalFunctionMapRecord,
@@ -98,7 +99,7 @@ class CodeGenDataReader {
Error success() { return error(cgdata_error::success); }
};
-class IndexedCodeGenDataReader : public CodeGenDataReader {
+class LLVM_ABI IndexedCodeGenDataReader : public CodeGenDataReader {
/// The codegen data file contents.
std::unique_ptr<MemoryBuffer> DataBuffer;
/// The header
@@ -139,7 +140,7 @@ class IndexedCodeGenDataReader : public CodeGenDataReader {
/// codegen data is recorded. `#` is used to indicate a comment.
/// The subsequent data is a YAML format per each codegen data in order.
/// Currently, it only has a function outlined hash tree.
-class TextCodeGenDataReader : public CodeGenDataReader {
+class LLVM_ABI TextCodeGenDataReader : public CodeGenDataReader {
/// The codegen data file contents.
std::unique_ptr<MemoryBuffer> DataBuffer;
/// Iterator over the profile data.
diff --git a/llvm/include/llvm/CGData/CodeGenDataWriter.h b/llvm/include/llvm/CGData/CodeGenDataWriter.h
index 1c4247608999a..faef6beb30aa6 100644
--- a/llvm/include/llvm/CGData/CodeGenDataWriter.h
+++ b/llvm/include/llvm/CGData/CodeGenDataWriter.h
@@ -16,6 +16,7 @@
#include "llvm/CGData/CodeGenData.h"
#include "llvm/CGData/OutlinedHashTreeRecord.h"
#include "llvm/CGData/StableFunctionMapRecord.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/Error.h"
@@ -45,7 +46,7 @@ class CGDataOStream {
// \c patch can only be called when all data is written and flushed.
// For raw_string_ostream, the patch is done on the target string
// directly and it won't be reflected in the stream's internal buffer.
- void patch(ArrayRef<CGDataPatchItem> P);
+ LLVM_ABI void patch(ArrayRef<CGDataPatchItem> P);
// If \c OS is an instance of \c raw_fd_ostream, this field will be
// true. Otherwise, \c OS will be an raw_string_ostream.
@@ -69,16 +70,16 @@ class CodeGenDataWriter {
~CodeGenDataWriter() = default;
/// Add the outlined hash tree record. The input hash tree is released.
- void addRecord(OutlinedHashTreeRecord &Record);
+ LLVM_ABI void addRecord(OutlinedHashTreeRecord &Record);
/// Add the stable function map record. The input function map is released.
- void addRecord(StableFunctionMapRecord &Record);
+ LLVM_ABI void addRecord(StableFunctionMapRecord &Record);
/// Write the codegen data to \c OS
- Error write(raw_fd_ostream &OS);
+ LLVM_ABI Error write(raw_fd_ostream &OS);
/// Write the codegen data in text format to \c OS
- Error writeText(raw_fd_ostream &OS);
+ LLVM_ABI Error writeText(raw_fd_ostream &OS);
/// Return the attributes of the current CGData.
CGDataKind getCGDataKind() const { return DataKind; }
diff --git a/llvm/include/llvm/CGData/OutlinedHashTree.h b/llvm/include/llvm/CGData/OutlinedHashTree.h
index 9ab36df863eef..d994b68f33ee4 100644
--- a/llvm/include/llvm/CGData/OutlinedHashTree.h
+++ b/llvm/include/llvm/CGData/OutlinedHashTree.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StableHashing.h"
#include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include <unordered_map>
@@ -54,9 +55,9 @@ class OutlinedHashTree {
/// the source and the stable_hash of the sink for an edge. These generic
/// callbacks can be used to traverse a OutlinedHashTree for the purpose of
/// print debugging or serializing it.
- void walkGraph(NodeCallbackFn CallbackNode,
- EdgeCallbackFn CallbackEdge = nullptr,
- bool SortedWalk = false) const;
+ LLVM_ABI void walkGraph(NodeCallbackFn CallbackNode,
+ EdgeCallbackFn CallbackEdge = nullptr,
+ bool SortedWalk = false) const;
/// Release all hash nodes except the root hash node.
void clear() {
@@ -71,10 +72,10 @@ class OutlinedHashTree {
/// \p GetTerminalCountOnly is true, it only counts the terminal nodes
/// (meaning it returns the the number of hash sequences in the
/// OutlinedHashTree).
- size_t size(bool GetTerminalCountOnly = false) const;
+ LLVM_ABI size_t size(bool GetTerminalCountOnly = false) const;
/// \returns the depth of a OutlinedHashTree by traversing it.
- size_t depth() const;
+ LLVM_ABI size_t depth() const;
/// \returns the root hash node of a OutlinedHashTree.
const HashNode *getRoot() const { return &Root; }
@@ -82,13 +83,13 @@ class OutlinedHashTree {
/// Inserts a \p Sequence into the this tree. The last node in the sequence
/// will increase Terminals.
- void insert(const HashSequencePair &SequencePair);
+ LLVM_ABI void insert(const HashSequencePair &SequencePair);
/// Merge a \p OtherTree into this Tree.
- void merge(const OutlinedHashTree *OtherTree);
+ LLVM_ABI void merge(const OutlinedHashTree *OtherTree);
/// \returns the matching count if \p Sequence exists in the OutlinedHashTree.
- std::optional<unsigned> find(const HashSequence &Sequence) const;
+ LLVM_ABI std::optional<unsigned> find(const HashSequence &Sequence) const;
private:
HashNode Root;
diff --git a/llvm/include/llvm/CGData/OutlinedHashTreeRecord.h b/llvm/include/llvm/CGData/OutlinedHashTreeRecord.h
index dd599ff6a7a62..d09218dbda73d 100644
--- a/llvm/include/llvm/CGData/OutlinedHashTreeRecord.h
+++ b/llvm/include/llvm/CGData/OutlinedHashTreeRecord.h
@@ -17,6 +17,7 @@
#define LLVM_CGDATA_OUTLINEDHASHTREERECORD_H
#include "llvm/CGData/OutlinedHashTree.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -40,13 +41,13 @@ struct OutlinedHashTreeRecord {
: HashTree(std::move(HashTree)) {};
/// Serialize the outlined hash tree to a raw_ostream.
- void serialize(raw_ostream &OS) const;
+ LLVM_ABI void serialize(raw_ostream &OS) const;
/// Deserialize the outlined hash tree from a raw_ostream.
- void deserialize(const unsigned char *&Ptr);
+ LLVM_ABI void deserialize(const unsigned char *&Ptr);
/// Serialize the outlined hash tree to a YAML stream.
- void serializeYAML(yaml::Output &YOS) const;
+ LLVM_ABI void serializeYAML(yaml::Output &YOS) const;
/// Deserialize the outlined hash tree from a YAML stream.
- void deserializeYAML(yaml::Input &YIS);
+ LLVM_ABI void deserializeYAML(yaml::Input &YIS);
/// Merge the other outlined hash tree into this one.
void merge(const OutlinedHashTreeRecord &Other) {
diff --git a/llvm/include/llvm/CGData/StableFunctionMap.h b/llvm/include/llvm/CGData/StableFunctionMap.h
index a3a85b92c3b30..bcb72e8216973 100644
--- a/llvm/include/llvm/CGData/StableFunctionMap.h
+++ b/llvm/include/llvm/CGData/StableFunctionMap.h
@@ -19,6 +19,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/StructuralHash.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -82,18 +83,18 @@ struct StableFunctionMap {
/// Get an existing ID associated with the given name or create a new ID if it
/// doesn't exist.
- unsigned getIdOrCreateForName(StringRef Name);
+ LLVM_ABI unsigned getIdOrCreateForName(StringRef Name);
/// Get the name associated with a given ID
- std::optional<std::string> getNameForId(unsigned Id) const;
+ LLVM_ABI std::optional<std::string> getNameForId(unsigned Id) const;
/// Insert a `StableFunction` object into the function map. This method
/// handles the uniquing of string names and create a `StableFunctionEntry`
/// for insertion.
- void insert(const StableFunction &Func);
+ LLVM_ABI void insert(const StableFunction &Func);
/// Merge a \p OtherMap into this function map.
- void merge(const StableFunctionMap &OtherMap);
+ LLVM_ABI void merge(const StableFunctionMap &OtherMap);
/// \returns true if there is no stable function entry.
bool empty() const { return size() == 0; }
@@ -107,10 +108,10 @@ struct StableFunctionMap {
/// \returns the size of StableFunctionMap.
/// \p Type is the type of size to return.
- size_t size(SizeType Type = UniqueHashCount) const;
+ LLVM_ABI size_t size(SizeType Type = UniqueHashCount) const;
/// Finalize the stable function map by trimming content.
- void finalize(bool SkipTrim = false);
+ LLVM_ABI void finalize(bool SkipTrim = false);
private:
/// Insert a `StableFunctionEntry` into the function map directly. This
diff --git a/llvm/include/llvm/CGData/StableFunctionMapRecord.h b/llvm/include/llvm/CGData/StableFunctionMapRecord.h
index f9b3ed7c646d6..d4d3ffa06ad25 100644
--- a/llvm/include/llvm/CGData/StableFunctionMapRecord.h
+++ b/llvm/include/llvm/CGData/StableFunctionMapRecord.h
@@ -18,6 +18,7 @@
#include "llvm/CGData/StableFunctionMap.h"
#include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
@@ -34,19 +35,20 @@ struct StableFunctionMapRecord {
/// A static helper function to serialize the stable function map without
/// owning the stable function map.
- static void serialize(raw_ostream &OS, const StableFunctionMap *FunctionMap);
+ LLVM_ABI static void serialize(raw_ostream &OS,
+ const StableFunctionMap *FunctionMap);
/// Serialize the stable function map to a raw_ostream.
- void serialize(raw_ostream &OS) const;
+ LLVM_ABI void serialize(raw_ostream &OS) const;
/// Deserialize the stable function map from a raw_ostream.
- void deserialize(const unsigned char *&Ptr);
+ LLVM_ABI void deserialize(const unsigned char *&Ptr);
/// Serialize the stable function map to a YAML stream.
- void serializeYAML(yaml::Output &YOS) const;
+ LLVM_ABI void serializeYAML(yaml::Output &YOS) const;
/// Deserialize the stable function map from a YAML stream.
- void deserializeYAML(yaml::Input &YIS);
+ LLVM_ABI void deserializeYAML(yaml::Input &YIS);
/// Finalize the stable function map by trimming content.
void finalize(bool SkipTrim = false) { FunctionMap->finalize(SkipTrim); }
diff --git a/llvm/include/llvm/CodeGen/AccelTable.h b/llvm/include/llvm/CodeGen/AccelTable.h
index f98e994b3f998..34c6fda7dcc17 100644
--- a/llvm/include/llvm/CodeGen/AccelTable.h
+++ b/llvm/include/llvm/CodeGen/AccelTable.h
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/DIE.h"
#include "llvm/CodeGen/DwarfStringPoolEntry.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DJB.h"
#include "llvm/Support/Debug.h"
#include <cstdint>
@@ -174,12 +175,12 @@ class AccelTableBase {
HashList Hashes;
BucketList Buckets;
- void computeBucketCount();
+ LLVM_ABI void computeBucketCount();
AccelTableBase(HashFn *Hash) : Hash(Hash) {}
public:
- void finalize(AsmPrinter *Asm, StringRef Prefix);
+ LLVM_ABI void finalize(AsmPrinter *Asm, StringRef Prefix);
ArrayRef<HashList> getBuckets() const { return Buckets; }
uint32_t getBucketCount() const { return BucketCount; }
uint32_t getUniqueHashCount() const { return UniqueHashCount; }
@@ -293,7 +294,8 @@ class DWARF5AccelTableData : public AccelTableData {
public:
static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
- DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID, const bool IsTU);
+ LLVM_ABI DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID,
+ const bool IsTU);
DWARF5AccelTableData(const uint64_t DieOffset,
const std::optional<uint64_t> DefiningParentOffset,
const unsigned DieTag, const unsigned UnitID,
@@ -348,7 +350,8 @@ class DWARF5AccelTableData : public AccelTableData {
/// If `Die` has a non-null parent and the parent is not a declaration,
/// return its offset.
- static std::optional<uint64_t> getDefiningParentDieOffset(const DIE &Die);
+ LLVM_ABI static std::optional<uint64_t>
+ getDefiningParentDieOffset(const DIE &Die);
protected:
std::variant<const DIE *, uint64_t> OffsetVal;
@@ -380,7 +383,7 @@ class DebugNamesAbbrev : public FoldingSetNode {
/// Get DIE Tag.
uint32_t getDieTag() const { return DieTag; }
/// Used to gather unique data for the abbreviation folding set.
- void Profile(FoldingSetNodeID &ID) const;
+ LLVM_ABI void Profile(FoldingSetNodeID &ID) const;
/// Returns attributes for an abbreviation.
const SmallVector<AttributeEncoding, 1> &getAttributes() const {
return AttrVect;
@@ -409,9 +412,9 @@ class DWARF5AccelTable : public AccelTable<DWARF5AccelTableData> {
/// Returns type units that were constructed.
const TUVectorTy &getTypeUnitsSymbols() { return TUSymbolsOrHashes; }
/// Add a type unit start symbol.
- void addTypeUnitSymbol(DwarfTypeUnit &U);
+ LLVM_ABI void addTypeUnitSymbol(DwarfTypeUnit &U);
/// Add a type unit Signature.
- void addTypeUnitSignature(DwarfTypeUnit &U);
+ LLVM_ABI void addTypeUnitSignature(DwarfTypeUnit &U);
/// Convert DIE entries to explicit offset.
/// Needs to be called after DIE offsets are computed.
void convertDieToOffset() {
@@ -437,9 +440,10 @@ class DWARF5AccelTable : public AccelTable<DWARF5AccelTableData> {
}
};
-void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
- StringRef Prefix, const MCSymbol *SecBegin,
- ArrayRef<AppleAccelTableData::Atom> Atoms);
+LLVM_ABI void
+emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
+ StringRef Prefix, const MCSymbol *SecBegin,
+ ArrayRef<AppleAccelTableData::Atom> Atoms);
/// Emit an Apple Accelerator Table consisting of entries in the specified
/// AccelTable. The DataT template parameter should be derived from
@@ -451,15 +455,16 @@ void emitAppleAccelTable(AsmPrinter *Asm, AccelTable<DataT> &Contents,
emitAppleAccelTableImpl(Asm, Contents, Prefix, SecBegin, DataT::Atoms);
}
-void emitDWARF5AccelTable(AsmPrinter *Asm, DWARF5AccelTable &Contents,
- const DwarfDebug &DD,
- ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
+LLVM_ABI void
+emitDWARF5AccelTable(AsmPrinter *Asm, DWARF5AccelTable &Contents,
+ const DwarfDebug &DD,
+ ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
/// Emit a DWARFv5 Accelerator Table consisting of entries in the specified
/// AccelTable. The \p CUs contains either symbols keeping offsets to the
/// start of compilation unit, either offsets to the start of compilation
/// unit themselves.
-void emitDWARF5AccelTable(
+LLVM_ABI void emitDWARF5AccelTable(
AsmPrinter *Asm, DWARF5Accel...
[truncated]
|
81256fc
to
34fc1b9
Compare
@compnerd @vgvassilev another one, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
Why is this called |
Seems the name |
The origins are even older than that. There is some discussion in this discourse from 2021 if you're interested. |
While it annotates the API, the declaration itself becomes part of the ABI. The annotations are to indicate what is the ABI boundary of the module to which it is applied to. |
Purpose
This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the
llvm/CGData
andllvm/CodeGen
libraries. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build.Background
This effort is tracked in #109483. Additional context is provided in this discourse, and documentation for
LLVM_ABI
and related annotations is found in the LLVM repo here.The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with
git clang-format
.The following manual adjustments were also applied after running IDS on Linux:
LLVM_ABI
to a subset of private class methods and fields that require exportLLVM_TEMPLATE_ABI
andLLVM_EXPORT_TEMPLATE
to exported instantiated templates defined via X-macroLLVM_ABI_FRIEND
to friend member functions declared withLLVM_ABI
#include "llvm/Support/Compiler.h"
to files where it was not auto-added by IDS due to no pre-existing block of include statements.LLVM_ABI
to a small number of symbols that require export but are not declared in headersValidation
Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: